package com.skzh.equipment.service.impl;

import java.util.List;
import com.skzh.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.skzh.equipment.mapper.HailerAnnouncementMapper;
import com.skzh.equipment.domain.HailerAnnouncement;
import com.skzh.equipment.service.IHailerAnnouncementService;

/**
 * 喊话参数配置Service业务层处理
 *
 * @author Lujk
 * @date 2025-03-21
 */
@Service
public class HailerAnnouncementServiceImpl implements IHailerAnnouncementService {
    @Autowired
    private HailerAnnouncementMapper hailerAnnouncementMapper;

    /**
     * 查询喊话参数配置
     *
     * @param id 喊话参数配置主键
     * @return 喊话参数配置
     */
    @Override
    public HailerAnnouncement selectHailerAnnouncementById(Long id) {
        return hailerAnnouncementMapper.selectHailerAnnouncementById(id);
    }

    /**
     * 查询喊话参数配置列表
     *
     * @param hailerAnnouncement 喊话参数配置
     * @return 喊话参数配置
     */
    @Override
    public List<HailerAnnouncement> selectHailerAnnouncementList(HailerAnnouncement hailerAnnouncement) {
        return hailerAnnouncementMapper.selectHailerAnnouncementList(hailerAnnouncement);
    }

    /**
     * 新增喊话参数配置
     *
     * @param hailerAnnouncement 喊话参数配置
     * @return 结果
     */
    @Override
    public int insertHailerAnnouncement(HailerAnnouncement hailerAnnouncement) {
        hailerAnnouncement.setCreateTime(DateUtils.getNowDate());
        return hailerAnnouncementMapper.insertHailerAnnouncement(hailerAnnouncement);
    }

    /**
     * 修改喊话参数配置
     *
     * @param hailerAnnouncement 喊话参数配置
     * @return 结果
     */
    @Override
    public int updateHailerAnnouncement(HailerAnnouncement hailerAnnouncement) {
        hailerAnnouncement.setUpdateTime(DateUtils.getNowDate());
        return hailerAnnouncementMapper.updateHailerAnnouncement(hailerAnnouncement);
    }

    /**
     * 批量删除喊话参数配置
     *
     * @param ids 需要删除的喊话参数配置主键
     * @return 结果
     */
    @Override
    public int deleteHailerAnnouncementByIds(Long[] ids) {
        return hailerAnnouncementMapper.deleteHailerAnnouncementByIds(ids);
    }

    /**
     * 删除喊话参数配置信息
     *
     * @param id 喊话参数配置主键
     * @return 结果
     */
    @Override
    public int deleteHailerAnnouncementById(Long id) {
        return hailerAnnouncementMapper.deleteHailerAnnouncementById(id);
    }
}
